package com.hk.controller;

import com.hk.domain.dto.DataSyncDTO;
import com.hk.service.business.sync.DataSyncBusiness;
import com.hk.utils.R;
import com.hk.utils.ValidatorUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DataController {

    @Autowired
    private DataSyncBusiness business;

    /**
     * 插入数据
     * @return
     */
    @PostMapping("postData")
    public R postData(@RequestBody DataSyncDTO dto) {
        ValidatorUtils.validateEntity(dto);
        return business.insertData(dto);
    }


}
